package com.gd.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {

	@RequestMapping(value = "/checkUsername.htm", method = RequestMethod.POST)
	@ResponseBody
	public String checkUsername(HttpServletRequest request,
			HttpServletResponse response, HttpSession session) {
		String uname = request.getParameter("username");
		String color = request.getParameter("color");
		/* check username and password */
		/* check end */
		session.setAttribute("username", uname);
		session.setAttribute("color", color);
		return "{'success':true,'checkResult':true}";
	}
}
